﻿using Xamarin.Forms;

namespace Moven.Views
{
	public partial class ArticleCell
	{
		public ArticleCell()
		{
			InitializeComponent();

#if __IOS__
			var separatorView = new BoxView
			{
				Color = Statics.SeparatorColor,
				HeightRequest = 0.5
			};
			container.Children.Add(separatorView);
#endif
		}

		protected override void OnBindingContextChanged()
		{
			var article = Article;
			if (article != null)
			{
				titleLabel.Text = article.Title;
				dateLabel.Text = article.Date;
				tagsLabel.Text = article.JoinedTags;
			}

			base.OnBindingContextChanged();
		} 
	}
}
